<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p>SharedWorker example</p>
    <p>请打开控制台看日志</p>
    <p>SharedWorker可以在不用标签页或iframe之间共享,比如可以在当前标签页发送消息，在另一标签页接受消息</p>
    <p>参考：https://www.cnblogs.com/cangqinglang/p/10635707.html</p>
    <a href="index2.html" target="_blank">index2.html</a>
    <script src="main.js"></script>
</body>
</html>